package com.aplink.generic.pojo.controlspec.gridview;

import com.aplink.generic.cache.ContentDataManager;
import com.aplink.generic.pojo.ContentData;
import com.aplink.generic.pojo.controlspec.ControlSpec;
import com.aplink.generic.util.ResourcesHelper;
import com.aplink.generic.util.objectrule.TargetCollection;

public class GridViewSpec extends ControlSpec {
	/**
	 * 
	 */
	private static final long serialVersionUID = -2333697134118006464L;
	private boolean isAutoRefresh;
	private boolean isSwipeToRefresh;
	private boolean isSwipeToRemove;
	private String mContentData;
	private ContentData mContentDataFile;
	private String mEmptyIcon;
	private String mEmptyMessage;
	private String mRowItem;
	private String mRptrdesign;
	private String mSwipeToRefreshTitle;

	private TargetCollection mTargetCollection;

	public GridViewSpec() {
	}

	public ContentData getContentData() {
		if (mContentDataFile == null) {
			mContentDataFile = ContentDataManager.getInstance().get(
			        getContentDataID());
		}
		return mContentDataFile;
	}

	public int getContentDataID() {
		return ResourcesHelper.getRawIdByName(this.mContentData);
	}

	public int getEmptyIconID() {
		return ResourcesHelper.getDrawableIdByName(mEmptyIcon);
	}

	public String getEmptyMessage() {
		return mEmptyMessage;
	}

	public String getRowItem() {
		return this.mRowItem;
	}

	public String getRptrdesign() {
		return this.mRptrdesign;
	}

	public int getRptrdesignID() {
		return ResourcesHelper.getRawIdByName(this.mRptrdesign);
	}

	public String getSwipeToRefreshTitle() {
		return mSwipeToRefreshTitle;
	}

	public TargetCollection getTargetCollection() {
		return mTargetCollection;
	}

	public boolean isAutoRefresh() {
		return isAutoRefresh;
	}

	public boolean isSwipeToRefresh() {
		return isSwipeToRefresh;
	}

	public boolean isSwipeToRemove() {
		return isSwipeToRemove;
	}

	public void setAutoRefresh(boolean isAutoRefresh) {
		this.isAutoRefresh = isAutoRefresh;
	}

	public void setContentData(final String contentData) {
		this.mContentData = contentData;
	}

	public void setEmptyIcon(String emptyIcon) {
		this.mEmptyIcon = emptyIcon;
	}

	public void setEmptyMessage(String emptyMessage) {
		mEmptyMessage = emptyMessage;
	}

	public void setRowItem(final String rowItem) {
		this.mRowItem = rowItem;
	}

	public void setRptrdesign(final String rptrdesign) {
		this.mRptrdesign = rptrdesign;
	}

	public void setSwipeToRefresh(boolean isSwipeToRefresh) {
		this.isSwipeToRefresh = isSwipeToRefresh;
	}

	public void setSwipeToRefreshTitle(String swipeToRefreshTitle) {
		mSwipeToRefreshTitle = swipeToRefreshTitle;
	}

	public void setSwipeToRemove(boolean isSwipeToRemove) {
		this.isSwipeToRemove = isSwipeToRemove;
	}

	public void setTargetCollection(TargetCollection targetCollection) {
		mTargetCollection = targetCollection;
	}
}
